<template>
  <div class="hello">
   <button @click="handleClickActionsheet">ok</button>
   <button @click="handleClickPickerValue">日期</button>
<mt-actionsheet
  :actions="data"
  v-model="sheetVisible">
</mt-actionsheet>
  <mt-datetime-picker
    ref="picker"
    type="datetime"
    :startDate="startDate" 
    v-model="pickerValue">
  </mt-datetime-picker>
  </div>
</template>

<script>
export default {
  name: 'HelloWorld',
  data () {
    return {
      sheetVisible:false,
      msg: '测试',
        // action sheet 选项内容
      data: [{
        name: '拍照',
        method : this.getCamera	// 调用methods中的函数
      }, {
        name: '从相册中选择', 
        method : this.getLibrary	// 调用methods中的函数
      }, {
        name: '从相册中选择', 
        method : this.getLibrary	// 调用methods中的函数
      }],
        pickerValue:'',
        startDate:new Date(),
        time:''
    }
  },
  methods:{
    handleClickActionsheet(){
      this.sheetVisible = !this.sheetVisible
    },
    getCamera: function(){
      console.log("打开照相机")
    },
    getLibrary: function(){
      console.log("打开相册")
    },
    handleClickPickerValue(){
      this.$refs.picker.open();
    }
  }
}
</script>

<style scoped>

</style>
